#include "StdAfx.h"
#include "RobotManager.h"

namespace RobotPlant { namespace RobotProxy{

	RobotManager::RobotManager(joint::spawn_type e):joint(e)
	{
		//chord(GetRobot, &RobotManager::Handle_GetRobot);
	}

	RobotManager::~RobotManager()
	{
	}

	boost::shared_ptr<RobotInstance> RobotManager::GetRobot(int index)
	{
		boost::mutex::scoped_lock lock(_mutex);

		boost::shared_ptr<RobotInstance> rob;
		if((index >= 0) && (index < _robInstances.size()))
			rob = _robInstances[index];

		return rob;
	}

	int RobotManager::GetRobotCount()
	{
		boost::mutex::scoped_lock lock(_mutex);

		int robCount = 0;
		robCount = _robInstances.size();

		return robCount;
	}
}}